package dcc.service;

import dcc.model.HighProfessionalQualificationInfo;
import dcc.persistence.HighProfessionalQualificationMapper;

public class HighProfessionalQualificationService extends BaseService {

	public HighProfessionalQualificationService() {
		super(HighProfessionalQualificationService.class);
	}

	private HighProfessionalQualificationMapper highProfessionalQualificationMapper;

	public void setHighProfessionalQualificationMapper(
			HighProfessionalQualificationMapper highProfessionalQualificationMapper) {
		this.highProfessionalQualificationMapper = highProfessionalQualificationMapper;
	}

	public void save(
			HighProfessionalQualificationInfo highProfessionalQualificationInfo) {
		if (highProfessionalQualificationInfo.getId() == 0) {
			insert(highProfessionalQualificationInfo);
		} else {
			update(highProfessionalQualificationInfo);
		}
	}

	private void insert(
			HighProfessionalQualificationInfo highProfessionalQualificationInfo) {
		highProfessionalQualificationMapper
				.insert(highProfessionalQualificationInfo);
	}

	private void update(
			HighProfessionalQualificationInfo highProfessionalQualificationInfo) {
		highProfessionalQualificationMapper
				.update(highProfessionalQualificationInfo);
	}

	public HighProfessionalQualificationInfo getHighProfessionalQualificationInfoByBaseId(
			int baseId) {
		return highProfessionalQualificationMapper
				.getHighProfessionalQualificationInfoByBaseId(baseId);
	}
}
